package com.example.dahua.policy;

/**
 * @author: dangwen
 * @createDate: 2021/7/3
 */
public class Person {
    private TravelStrage travelStrage;
    public Person(TravelStrage travelStrage){
        this.travelStrage = travelStrage;
    }
    public void doTravel(){
        travelStrage.travel();
    }
    public static void main(String[] args) {
        Person person = new Person(new CarTravel());
        person.doTravel();
        Person person1 = new Person(new TrainTravel());
        person1.doTravel();
    }
}
